<template>
    <div class="box">
        <FormCom :config="config" @submitForm="submit"></FormCom>
    </div>
</template>

<script>
// 普通搜索查询demo
import FormCom from "../components/formContainer/index";
export default {
    name: "autoForm",
    components: { FormCom },
    data() {
        return {
            config: {
                layout: "horizontal",
                okTxt: "查询",
                item: [
                    {
                        key: "name",
                        type: "input",
                        label: "姓名",
                        style: { width: "350px" },
                    },
                    {
                        key: "xiaoqu",
                        type: "input",
                        label: "小区名",
                        style: { width: "350px" },
                    },
                    {
                        key: "penson",
                        type: "select",
                        label: "联系人",
                        style: { width: "350px" },
                        api: "/api/data",
                        apiLabel: "lifeList"
                    },
                    {
                        key: "type",
                        type: "select",
                        label: "类型",
                        style: { width: "350px" },
                        options: [
                            { value: "1", label: "aaa" },
                            { value: "2", label: "bbb" },
                        ]
                    },
                    {
                        key: "cascader",
                        type: "cascader",
                        label: "选择部门",
                        style: { width: "350px" },
                        api: "/api/tree",
                        apiLabel: "tree",
                    },
                    {
                        key: "logo",
                        type: "input",
                        label: "logo名称",
                        style: { width: "350px" },
                        suffixIcon: "el-icon-date"
                    },
                ]
            }
        }
    },
    methods: {
        submit(val) {
            console.log(val)
        }
    },
};
</script>

<style></style>

